/**
* UserGMaps Edit settings Page
*
* This creates the Users Google Map Panel with an Iframe which loads the GMap.
*
* JSLint Validated: 
*
* @access 	public
* @author 	Rob
* @copyright	ResMania 2009 all rights reserved.
* @version	1.0
* @link		http://developer.resmania.com
* @since  	05-2009
*/

RM.Pages.Plugin_UserGMaps_Panel = new Ext.FormPanel({
    id : 'rm_pages_plugins_UserGMaps_main_form',
    title: RM.Translate.Admin.UserGMaps.Main.Title,
    padding: "40px 60px 100px 60px",
    items: ({
        // create a managed iframe
        xtype: 'iframepanel',
        id: 'rm_pages_plugins_usergmaps_iframe',
        closable: false,
        loadMask: true,
        frame: true,
        layout: 'fit',
        height: 405
    }),
    listeners: {
        // this causes the map to reload when the tab is change or another user is loaded
        'afterlayout': function(){

            var URL = RM.Common.AssembleURL({
                controller: 'UserGMaps',
                action: 'getmap',
                parameters : [{
                    name : 'id',
                    value : Ext.getCmp('edit_users[id]').value
                }]
            });

            // set the new source url for the iframe containing the gmap
            Ext.getCmp("rm_pages_plugins_usergmaps_iframe").setSrc(URL);
        }
    }
});


RM.Pages.Users_Edit_TabPanel.add(RM.Pages.Plugin_UserGMaps_Panel);